From ad27c9e7aa0aef8929071b2d095cb37ae24d922c Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 16 Jan 2008 08:10:15 +0000 Subject: [PATCH] (comint-regexp-arg): Fix no-input case. --- lisp/comint.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/comint.el b/lisp/comint.el index 0a22cdba5c9..f8a47152976 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1021,9 +1021,11 @@ See also `comint-read-input-ring'." (last-command last-command) (regexp (read-from-minibuffer prompt nil nil nil 'minibuffer-history-search-history))) + ;; If the user didn't enter anything, nothing is added to m-h-s-h. + ;; Use the previous search regexp, if there is one. (list (if (string-equal regexp "") - (setcar minibuffer-history-search-history - (nth 1 minibuffer-history-search-history)) + (or (car minibuffer-history-search-history) + regexp) regexp) (prefix-numeric-value current-prefix-arg)))) -- 2.30.2